<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Vendor styles -->
<link rel="stylesheet" href="../css/bootstrap.min.css" />
<link rel="stylesheet" href="../css/leftnav.css" />
<style type="text/css">
html,body{
	height: 100%;
}
</style>
</head>
<body>
	<!-- 顶部 -->
	<div class="navbar navbar-duomi navbar-static-top" role="navigation" style="height: 10%;">
        <div class="container-fluid">
            <div class="navbar-header">
                <div class="navbar-brand" href="/Admin/index.html" id="logo">宠物医院信息管理系统
                </div>
            </div>
        </div>
	</div>
	
	<div class="container-fluid">
		<div class="row">
			 <div id='leftnav1' class="col-xs-2" style="margin-top: 100px;margin-bottom: 100px;">
			 <!--导航栏  --><script>
	var sf = getCookie('staff');
	if(isNotEmpty(sf)){
		$('#'+sf).siblings("li.panel").hide();
	}

</script>


<ul id="accordion" class="main-nav nav nav-tabs nav-stacked" >
      <li class="active">
              <%-- 全局修改三 : a标签调转 http://localhost/qiantai/index.jsp--%>
              <a href="http://localhost/qiantai/index.jsp"><i class="glyphicon glyphicon-th-large"></i>首页</a>
      </li>

      <li class="panel">
          <a href="#role" class="nav-header collapsed" data-toggle="collapse" data-parent="#accordion">
              <i class="glyphicon glyphicon-cog"></i>科室管理<span class="pull-right glyphicon glyphicon-chevron-down"></span>
          </a>
          <ul id="role" class="nav nav-list collapse secondmenu" style="height: 0px;">
              <li><a href="role.jsp"><i class="glyphicon glyphicon-user"></i>查看科室</a></li>
              <li><a href="role_add.jsp"><i class="glyphicon glyphicon-th-list"></i>增加科室</a></li>
          </ul>
      </li>
      <li class="panel">
          <a href="#staff" class="nav-header collapsed" data-toggle="collapse" data-parent="#accordion">
              <i class="glyphicon glyphicon-cog"></i>医生管理<span class="pull-right glyphicon glyphicon-chevron-down"></span>
          </a>
          <ul id="staff" class="nav nav-list collapse secondmenu" style="height: 0px;">
              <li><a href="staff.jsp"><i class="glyphicon glyphicon-user"></i>查看医生</a></li>
              <li><a href="staff_add.jsp"><i class="glyphicon glyphicon-th-list"></i>增加医生</a></li>
          </ul>
      </li>
      <li class="panel">
          <a href="#user" class="nav-header collapsed" data-toggle="collapse" data-parent="#accordion">
              <i class="glyphicon glyphicon-cog"></i>用户管理<span class="pull-right glyphicon glyphicon-chevron-down"></span>
          </a>
          <ul id="user" class="nav nav-list collapse secondmenu" style="height: 0px;">
              <li><a href="user.jsp"><i class="glyphicon glyphicon-user"></i>查看用户</a></li>
              <li><a href="user_add.jsp"><i class="glyphicon glyphicon-th-list"></i>增加用户</a></li>
          </ul>
      </li>

      <li class="panel" id="role2">
          <a href="#repair" class="nav-header collapsed" data-toggle="collapse" data-parent="#accordion">
              <i class="glyphicon glyphicon-cog"></i>病例管理<span class="pull-right glyphicon glyphicon-chevron-down"></span>
          </a>
          <ul id="repair" class="nav nav-list collapse secondmenu" style="height: 0px;">
              <li><a href="repair.jsp"><i class="glyphicon glyphicon-user"></i>查看病例</a></li>
              <li><a href="repair_add.jsp"><i class="glyphicon glyphicon-th-list"></i>增加病例</a></li>
          </ul>
      </li>
      <li class="panel" id="role3">
          <a href="#complaints" class="nav-header collapsed" data-toggle="collapse" data-parent="#accordion">
              <i class="glyphicon glyphicon-cog"></i>美容管理<span class="pull-right glyphicon glyphicon-chevron-down"></span>
          </a>
          <ul id="complaints" class="nav nav-list collapse secondmenu" style="height: 0px;">
              <li><a href="complaints.jsp"><i class="glyphicon glyphicon-user"></i>查看美容信息</a></li>
              <li><a href="complaints_add.jsp"><i class="glyphicon glyphicon-th-list"></i>增加美容信息</a></li>
          </ul>
      </li>
      <li class="">
          <a href="../index.jsp"><i class="glyphicon glyphicon-th-large"></i>安全退出</a>
      </li>
</ul>
			 </div>
			 
			 <div id='leftnav2' class="col-xs-10">
			 
			 <div class="page-header">
			    <h1>添加治疗处理
			        <small>
			        	<a href="repair.jsp">查看治疗处理</a>
			        </small>
			    </h1>
			</div>
			 
			 <form class="form-horizontal" role="form">
				  <div class="form-group">
				    <label for="title" class="col-sm-1 control-label">宠物名</label>
				    <div class="col-sm-6">
				      <input type="text" class="form-control" id="title" placeholder="" />
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="building" class="col-sm-1 control-label">主人名</label>
				    <div class="col-sm-6">
				      <input type="text" class="form-control" id="building" placeholder="" />
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="houseNum" class="col-sm-1 control-label">宠物编号</label>
				    <div class="col-sm-6">
				      <input type="text" class="form-control" id="houseNum" placeholder="" />
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="name" class="col-sm-1 control-label">宠物年龄</label>
				    <div class="col-sm-6">
				      <input type="text" class="form-control" id="name" placeholder="" />
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="detail" class="col-sm-1 control-label">病因</label>
				    <div class="col-sm-6">
				      <input type="text" class="form-control" id="detail" placeholder="" />
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="phonenumber" class="col-sm-1 control-label">主人电话</label>
				    <div class="col-sm-6">
				      <input type="text" class="form-control" id="phonenumber" placeholder="" />
				    </div>
				  </div>
			       <div class="form-group">
				    <label for="evaluation" class="col-sm-1 control-label">医嘱</label>
				    <div class="col-sm-6">
				      <textarea class="form-control" rows="5" id="evaluation"></textarea>
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="cpTime" class="col-sm-1 control-label">就诊时间</label>
				    <div class="col-sm-6">
				      <input type="text" class="form-control" id="cpTime" placeholder="" />
				    </div>
				  </div>
				  <div class="form-group">
				    <div class="col-sm-offset-2 col-sm-10">
				      <button id='add_repair' type="submit" class="btn btn-primary col-sm-1">添加</button>
				    </div>
				  </div>
				</form>
			 </div>
		</div> 
	</div>
	
	<script type="text/javascript" src="../js/jquery-1.11.3.min.js"></script>
	<script src="../js/bootstrap.min.js"></script>
	<script src="../js/public_fuc.js"></script>
	<script type="text/javascript">
      $(function() {
        $("#leftnav").load("pubnav.html");
        addRepair();
      });
      
      
      
	       //增加repair
	      function addRepair(){
	      	$('#add_repair').click(function(){
	      	
		    	  var obj = {};
				  obj.title = $('#title').val();
				  obj.building = $('#building').val();
				  obj.houseNum = $('#houseNum').val();
				  obj.name = $('#name').val();
				  obj.detail = $('#detail').val();
				  obj.phone = $('#phonenumber').val();
				  obj.evaluation = $('#evaluation').val();
				  var date = new Date();
				  obj.cpTime = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate();
				  
		    	  $.post("../api/repair/save",obj,function(data){
		    	  	  //console.log(data);
		    	  	  if (data.code==0) {
		    			  window.location.href = 'repair.jsp';
		    		  }
		    	  });
	    		  return false;
	    	  });
	      }
      
    </script> 
</body>
</html>